<?php use_helper('Tags') ?>

<?php slot('fb_meta') ?>
	<meta property = 'og:title' content = '<?php echo $article->getName(); ?>' />
	<meta property = 'og:type' content = 'product' />
	<meta property = 'og:url' content = 'http://www.mimercado.es/articulo/<?php echo $article->getSlug() ?>'/>
	<meta property = 'og:image' content = 'http://www.mimercado.es/images/logo.png' />
	<meta property = 'og:site_name' content = 'MiMercado.es' />
	<meta property = 'og:description' content = '<?php echo $article->getDescription() ?>' />
	<meta property = 'fb:app_id' content = '136003349748069' />
<?php end_slot(); ?>

<?php slot('custom_css') ?>
	<link href="<?php echo url_for('site/css?site_id='.$site->getId()) ?>" rel="stylesheet" type="text/css" />
<?php end_slot(); ?>

<div class="header">
	<?php if ($isSiteAdmin): ?>
		<div id="admin_actions">
			<?php echo link_to("Editar",'site/editArticle?id='.$article->getId()) ?>&nbsp;|&nbsp;
			<?php echo link_to("Eliminar",'site/deleteArticle?id='.$article->getId(),
					array('confirm' => "¿Está seguro que desea eliminar este artículo?")) ?>
		</div>
	<?php endif; ?>
	<h1><?php echo $article->getName(); ?></h1>
	<h2>de <?php echo link_to($site->getName(), "site/index?name=".$site->getSlug())?></h2>
</div>

<?php if($sf_user->hasFlash('error')):?>
    <?php include_partial('global/msg', array('class'=>'error', 'msg'=>$sf_user->getFlash('error'))); ?>
<?php endif;?>
<?php if($sf_user->hasFlash('success')):?>
    <?php include_partial('global/msg', array('class'=>'success', 'msg'=>$sf_user->getFlash('success'))); ?>
<?php endif;?>

<div id="product_gallery" class="pikachoose">
	<center>
	<ul id="pikame">
		<?php foreach ($article->getPictures() as $image): ?>
			<li><a href="#"><?php echo image_tag($image->getFileName()); ?></a><span><?php echo $image->getDescription() ?></span></li>
		<?php endforeach; ?>
	</ul>
	</center>
</div>

<div id="product_info">
	<?php $price = explode(".",$article->getPrice()); ?>
	<span class="price">$<?php echo $price[0] ?><span style="font-size: 0.6em; vertical-align: top;"><?php echo $price[1] ?></span></span>
	<div>Ubicación: <?php echo $site->getLocation() ?></div>
	<div>Tags: <?php echo tag_list($article->getTags(), 'home/tag?name=') ?></div>

	<?php if ($site->getPaymentEnabled()): ?>
		<!-- Pago con DineroMail -->
		<form action='https://argentina.dineromail.com/Shop/Shop_Ingreso.asp' method='post'>
			<input type='hidden' name='NombreItem' value='<?php echo $article->getName() ?>'>
			<input type='hidden' name='TipoMoneda' value='1'>
			<input type='hidden' name='PrecioItem' value='<?php echo $article->getPrice() ?>'>
			<input type='hidden' name='E_Comercio' value='<?php echo $site->getDineromailStoreId() ?>'>
			<input type='hidden' name='NroItem' value='<?php echo $article->getId() ?>'>
			<input type='hidden' name='image_url' value='http://'>
			<input type='hidden' name='DireccionExito' value='http://'>
			<input type='hidden' name='DireccionFracaso' value='http://'>
			<input type='hidden' name='DireccionEnvio' value='1'>
			<input type='hidden' name='Mensaje' value='1'>
			<input type='image' src='https://argentina.dineromail.com/imagenes/botones/comprar-medios_c.gif' border='0' name='submit' alt='Pagar con DineroMail'>
		</form>
	<?php else: ?>
		<div>El vendedor no tiene la plataforma de pagos habilitada, ponte en contacto con él para adquirir este producto.</div>
	<?php endif; ?>
</div>

<div id="description">
	<?php echo html_entity_decode($article->getDescription()) ?>
</div>

<div id="comments" class="comments">
<center>
	<fb:comments width="700"></fb:comments>
</center>
</div>


<script language="javascript">
<!--
	$(document).ready(
		function (){
			$("#pikame").PikaChoose({show_prev_next:false, thumb_width:69});
	});
-->
</script>
